<h1 class="textos">Meus textos</h1>
<form method="post" action="<?=$this->baseUrl ?>/admintextos/">
<label>Busca:</label> <input type="text" value="<?=$this->busca ?>" name="busca" /> <input type="submit" value="procurar" /> 
</form>
<table width="905" class="tabela_listagem">
	<thead>
		<th><a href="<?=$this->baseUrl ?>/admintextos/index/filtro/titulo/ordem/<?if(isset($this->ordem) && $this->ordem == "asc"):?><?=$ordem = "desc"; else:?><?=$ordem = "asc"; endif; ?>"> Título </a></th>
		<th>Áreas de conhecimento</th>
		<th><a href="<?=$this->baseUrl ?>/admintextos/index/filtro/data/ordem/<?if(isset($this->ordem) && $this->ordem == "asc"):?><?=$ordem = "desc"; else:?><?=$ordem = "asc"; endif; ?>"> Última Atualização </a></th>
		<? if ($this->perfil == 'administrador') :?><th>Autor</th><? endif; ?>


		<th colspan="6" align="center" width="250">Operações</th>
	</thead>
	<tbody>
			<?
			foreach ( $this->paginator as $texto ) :
			?>
		<tr>
			<td width="150"><a href="<?=$this->baseUrl ?>/textos/ver/id/<?=$texto->id ?>"><strong><?=$texto->titulo?></strong></a></td>
			<td><? foreach($texto->findAreasViaAreasTextosByTexto() as $a): ?>
			- <?=$a->nome ?> 
			<? endforeach; ?>
			</td>
			<td width="155"><?=$texto->data?></td>

			<? if ($this->perfil != 'professor') :?><th><?=$texto->findParentUsuarios()->nome?></th><? endif; ?>
			
			<td align="center"><a
				href="<?=$this->baseUrl?>/lacunas/administrar/id/<?=$texto->id?>">lacunas</a></td>
				
			<td align="center"><a
				href="<?=$this->baseUrl?>/questionarios/administrar/id/<?=$texto->id?>">questionários</a></td>
			
			<td align="center"><a
				href="<?=$this->baseUrl?>/admintextos/editarimg/id/<?=$texto->id?>">imagens</a></td>
			
			<td align="center"><a
				href="<?=$this->baseUrl?>/adminturmas/editarturmasdotexto/id/<?=$texto->id?>">turmas</a></td>
			
			<td align="center"><a
				href="<?=$this->baseUrl?>/admintextos/editar/id/<?=$texto->id?>"><img width="20" height="20" alt="editar" title="editar texto" src="<?=$this->publicUrl?>/imagens/editar2.jpg" /></a></td>
				
			<td align="center"><a
				href="<?=$this->baseUrl?>/admintextos/apagar/id/<?=$texto->id?>"><img width="20" height="20" alt="apagar" title="apagar texto" src="<?=$this->publicUrl?>/imagens/excluir.jpg" /></a></td>
		</tr>
				<?
				endforeach;
				?>
				</tbody>
</table>
<br clear="all" />
<?= $this->paginator; ?>

